<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" href="{:__CSS__}jiuzhen.css" />
        <title>就诊</title>
        <script type="text/javascript" src="{:__JS__}jquery-1.11.3.js"></script>
        <script type="text/javascript" src="{:__JS__}rem.js"></script>
        <script type="text/javascript" src="{:__JS__}iscroll-lite.js"></script>
        <script type="text/javascript" src="{:__JS__}iscroll-probe.js"></script>
        <script type="text/javascript" src="{:__JS__}layer/layer.js"></script>
        <script type="text/javascript">
            function isPassive() {
                var supportsPassiveOption = false;
                try {
                    addEventListener("test", null, Object.defineProperty({}, 'passive', {
                        get: function () {
                            supportsPassiveOption = true;
                        }
                    }));
                } catch (e) {
                }
                return supportsPassiveOption;
            }

            document.addEventListener('touchmove', function (e) {
                e.preventDefault();
            }, isPassive() ? {
                capture: false,
                passive: false
            } : false);

            var kind;
            var myScroll;
            var pullDownEl, pullDownL;
            var pullUpEl, pullUpL;
            var Downcount = 0, Upcount = 0;
            var loadingStep = 0;//加载状态0默认，1显示加载状态，2执行加载数据，只有当为0时才能再次加载，这是防止过快拉动刷新  
			var num=1;

            function pullDownAction() {
            	num=1;
            	if(sessionStorage.getItem("tid")==null){
					sessionStorage.setItem("tid","0");
				}
            	$("#add").html("");
                setTimeout(function () {
                	getList(num,name);
                    pullDownEl.removeClass('loading');
                    pullDownL.html('下拉显示更多...');
                    pullDownEl['class'] = pullDownEl.attr('class');
                    pullDownEl.attr('class', '').hide();
                    myScroll.refresh();
                    loadingStep = 0;
                }, 1000); //1秒  
            }
            function pullUpAction() {
            	num+=1;
                setTimeout(function () {
                	getList(num,name);
                    pullUpEl.removeClass('loading');
                    pullUpL.html('上拉显示更多...');
                    pullUpEl['class'] = pullUpEl.attr('class');
                    pullUpEl.attr('class', '').hide();
                    myScroll.refresh();
                    loadingStep = 0;
                }, 1000);
            }
            function loaded() {
                kind = new IScroll('#wrapper1', {mouseWheel: true,click: true});
                pullDownEl = $('#pullDown');
                pullDownL = pullDownEl.find('.pullDownLabel');
                pullDownEl['class'] = pullDownEl.attr('class');
                pullDownEl.attr('class', '').hide();
                pullUpEl = $('#pullUp');
                pullUpL = pullUpEl.find('.pullUpLabel');
                pullUpEl['class'] = pullUpEl.attr('class');
                pullUpEl.attr('class', '').hide();

                myScroll = new IScroll('#content', {
                    probeType: 2, //probeType：1对性能没有影响。在滚动事件被触发时，滚动轴是不是忙着做它的东西。probeType：2总执行滚动，除了势头，反弹过程中的事件。这类似于原生的onscroll事件。probeType：3发出的滚动事件与到的像素精度。注意，滚动被迫requestAnimationFrame（即：useTransition：假）。  
                    scrollbars: false, //有滚动条  
                    mouseWheel: true, //允许滑轮滚动  
                    fadeScrollbars: true, //滚动时显示滚动条，默认影藏，并且是淡出淡入效果  
                    bounce: true, //边界反弹  
                    interactiveScrollbars: true, //滚动条可以拖动  
                    shrinkScrollbars: 'scale', // 当滚动边界之外的滚动条是由少量的收缩。'clip' or 'scale'.  
                    click: true, // 允许点击事件  
                    keyBindings: true, //允许使用按键控制  
                    momentum: true// 允许有惯性滑动  
                });
                //滚动时  
                myScroll.on('scroll', function () {
                    if (loadingStep == 0 && !pullDownEl.attr('class').match('flip|loading') && !pullUpEl.attr('class').match('flip|loading')) {
                        if (this.y > 5) {
                            //下拉刷新效果  
                            pullDownEl.attr('class', pullUpEl['class'])
                            pullDownEl.show();
                            myScroll.refresh();
                            pullDownEl.addClass('flip');
                            pullDownL.html('准备刷新...');
                            loadingStep = 1;
                        } else if (this.y < (this.maxScrollY - 5)) {
                            //上拉刷新效果  
                            pullUpEl.attr('class', pullUpEl['class'])
                            pullUpEl.show();
                            myScroll.refresh();
                            pullUpEl.addClass('flip');
                            pullUpL.html('准备刷新...');
                            loadingStep = 1;
                        }
                    }
                });
                //滚动完毕  
                myScroll.on('scrollEnd', function () {
                    if (loadingStep == 1) {
                        if (pullUpEl.attr('class').match('flip|loading')) {
                            pullUpEl.removeClass('flip').addClass('loading');
                            pullUpL.html('Loading...');
                            loadingStep = 2;
                            pullUpAction(num);
                        } else if (pullDownEl.attr('class').match('flip|loading')) {
                            pullDownEl.removeClass('flip').addClass('loading');
                            pullDownL.html('Loading...');
                            loadingStep = 2;
                            pullDownAction(1);
                        }
                    }
                });
            }

        </script>
    </head>
    <body onload="loaded()">
        <!--搜索-->
        <div class="serch">
            <input type="" name="" id="" value="" placeholder="搜索医生名字、科室、疾病"/>
            <b></b>
            <span class="quxiao">取消</span>
            <a href="form.html"></a>
        </div>
        <div id="wrapper1">
            <div id="scroller1">
                <ul>
                    <li data-id="0">全部<span class="sanjiao"></span></li>
                    <foreach name="section" item="v">
                        <li data-id="{$v.id}">{$v.name}<span class="sanjiao"></span></li>
                    </foreach>
                </ul>
            </div>
        </div>
        <!--中间部分内容-->
        <div class="inner">
            <!--<ul class="shaixuan">
                    <li class="click">综合排序 <b style="display: block;"></b></li>
                    <li>按响应时间 <b></b></li>
                    <li>按人气指数 <b></b></li>
            </ul>-->

            <div id="content">  
                <div id="scroller">  
                    <div id="pullDown" class="ub ub-pc c-gra">  
                        <div class="pullDownIcon"></div>  
                        <div class="pullDownLabel">下拉刷新</div>  
                    </div>  
                    <ul id="add"> 
                        <foreach name="data" item="v">
                            <li data-did="{$v.did}">
                                <ul class="detail">
                                    <li><img src="{$v.header}"/></li>
                                    <li>
                                        <p>
                                            <span>{$v.name}</span>
                                            <!--<span class="price">9元/次</span>-->
                                        </p>
                                        <p>{$v.title}</p>
                                        <p>{$v.address}</p>
                                    </li>
                                    <li>{$v.intro}</li>
                                </ul>
                                <div class="yuyue">
                                    <span style="display: none;">以接诊{$v.reception_count}人</span>
                                    <span onclick="tanchuang(event)">挂号预约</span>
                                </div>
                            </li> 
                        </foreach>
                    </ul>  
                    <div id="pullUp" class="ub ub-pc c-gra">  
                        <div class="pullUpIcon"></div>  
                        <div class="pullUpLabel">上拉显示更多...</div>  
                    </div>  
                </div>  
            </div>  


        </div>

        <!--搜索-->
        <div class="sousuo">
            <!--<ul>
                <li class="active">最近搜索</li>
                <li>热门搜索</li>
            </ul>-->
            <div class="lishi">
                <ul>
                    <!--<li>鼻炎</li>
                    <li>发的地方</li>
                    <li>发到说的</li>
                    <li>鼻炎</li>
                    <li>佛挡杀佛</li>
                    <li>鼻炎</li>-->
                </ul>
            </div>
            <!--<div class="hot">
                <ul>
                    <li>脱发</li>
                    <li>脱发</li>
                    <li>脱发</li>
                    <li>脱发</li>
                    <li>脱发</li>
                    <li>脱发</li>
                </ul>
            </div>-->
        </div>


    </body>
    <script type="text/javascript">
        var  url = "{:IMG_SERVER}";
        var  lat  =  "";
        var  lng  =  "";
    </script>
    <script src="{:__JS__}jquery.validate.js"></script>
    <script type="text/javascript" src="{:__JS__}yuyue.js"></script>
    <!--<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>-->
    <!--<script>
            var  url  =  "{:APP_PATH}";
            var  juli  =  {$juli};
            
            wx.config({
            //debug:  true,
            appId:  '{$signPackage.appId}',
                            timestamp:  '{$signPackage.timestamp}',
                            nonceStr:  '{$signPackage.nonceStr}',
                            signature:  '{$signPackage.signature}',
                            jsApiList:  [
                                            'checkJsApi',
                                            'openLocation',
                                            'getLocation'
                            ]
            });
            /*
              *  注意：
              *  1.  所有的JS接口只能在公众号绑定的域名下调用，公众号开发者需要先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”。
              *  2.  如果发现在  Android  不能分享自定义内容，请到官网下载最新的包覆盖安装，Android  自定义分享接口需升级至  6.0.2.58  版本及以上。
              *  3.  完整  JS-SDK  文档地址：http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
              *
              *  如有问题请通过以下渠道反馈：
              *  邮箱地址：weixin-open@qq.com
              *  邮件主题：【微信JS-SDK反馈】具体问题
              *  邮件内容说明：用简明的语言描述问题所在，并交代清楚遇到该问题的场景，可附上截屏图片，微信团队会尽快处理你的反馈。
              */
            wx.ready(function  ()  {
            //  1  判断当前版本是否支持指定  JS  接口，支持批量判断
            wx.checkJsApi({
            jsApiList:  [
                            'getLocation'
                                                    ],
                                                                    success:  function  (res)  {
                           if (res.checkResult.getLocation == false) {
    alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
            return;
            }
            }
    });
    wx.getLocation({
    type: 'gcj02',
    success: function (res) {
        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
    var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
    var speed = res.speed; // 速度，以米/每秒计
    var accuracy = res.accuracy; // 位置精度
    
    var dq = getDisance(lat,lng, latitude, longitude);
    if (dq > juli) {
        layer.open({
            content: '当前不在签到范围内',
    btn: '确定',
    yes: function (index) {
        $(".sign-box .swai,.sign-box .snei").addClass("nobot");
    $("#selectfiles").removeAttr("id");
    $("input[type='file']").attr("disabled","disabled")
                    layer.close(index);
                }
            });
        }
    },
    cancel: function (res) {
        alert('用户拒绝授权获取地理位置');
        }
    });
    wx.error(function (res) {
    alert(res.errMsg);
    });
    });
    
    </script>
    -->
    
</html>